﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NC.Cather;
using NC.Infrastructure.Domain;

namespace NC.Infrastructure.Data
{
    public interface IUnitOfWork
    {   
        int Commit();
        IDbSet<TEntity> Set<TEntity>() where TEntity : BaseEntity;
        IEnumerable<TElement> SqlQuery<TElement>(string sql, params object[] parameters);
        int ExecuteSqlCommand(string sql, bool doNotEnsureTransaction = false, int? timeout = null, params object[] parameters);
        void Detach(object entity);
        TEntity AttachEntityToContext<TEntity>(TEntity entity, EntityState state = EntityState.Modified) where TEntity : BaseEntity;
    }
}
